<template>
  <div>
    购物车
  </div>
</template>

<script>
export default {
  beforeRouteEnter (to, from, next) {
    if (localStorage.getItem('token')) {
      next()
    } else {
      console.log('重定向，回到log页面')
      next('/login')
    }
  }
}
</script>
